package com.jxw.launcher;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import java.util.List;

/* loaded from: classes.dex */
public class TabAdapter extends BaseQuickAdapter<TabBean, BaseViewHolder> {
    List<TabBean> data;
    private RadiaoOnItemClickListener listener;
    private int selectPosition;

    /* loaded from: classes.dex */
    public interface RadiaoOnItemClickListener {
        void onSelectClick(int i);
    }

    public void setData(List<TabBean> list) {
        this.data = list;
        notifyDataSetChanged();
    }

    public void setChoosePosition(int i) {
        this.selectPosition = i;
        notifyDataSetChanged();
    }

    public TabAdapter(int i, List<TabBean> list) {
        super(i, list);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.chad.library.adapter.base.BaseQuickAdapter
    public void convert(final BaseViewHolder baseViewHolder, TabBean tabBean) {
        ImageView imageView = (ImageView) baseViewHolder.getView(R.id.iv_tab_icon);
        TextView textView = (TextView) baseViewHolder.getView(R.id.tv_tab_title);
        if (this.selectPosition == baseViewHolder.getAdapterPosition()) {
            imageView.setBackgroundResource(tabBean.getTab_Press());
        } else {
            imageView.setBackgroundResource(tabBean.getTab_Normal());
        }
        textView.setText(tabBean.getTab_Title());
        imageView.setOnClickListener(new View.OnClickListener() { // from class: com.jxw.launcher.TabAdapter.1
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                if (TabAdapter.this.listener != null) {
                    TabAdapter.this.listener.onSelectClick(baseViewHolder.getAdapterPosition());
                }
            }
        });
    }

    public void setOnItemClickListener(RadiaoOnItemClickListener radiaoOnItemClickListener) {
        this.listener = radiaoOnItemClickListener;
    }
}
